package com.bigger.controller;

import com.bigger.entity.BusinessMP;
import com.bigger.result.Result;
import com.bigger.service.BusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/user/business")
public class BusinessController {
    @Autowired
    private BusinessService businessService;
    @GetMapping("/get")
    public Result<List<BusinessMP>> get(String key){
        List<BusinessMP> businessMPS=businessService.get(key);
        return Result.success(businessMPS);
    }
    @GetMapping("/get/{id}")
    public Result<BusinessMP> getById(@PathVariable("id") Long id){
        BusinessMP businessMP=businessService.getById(id);
        return Result.success(businessMP);
    }
}
